import React, { Component } from 'react';
import {Provider} from 'react-redux';
import store from './store'
import {Redirect} from 'react-router-dom';
import  {Route,Switch,HashRouter}from 'react-router-dom';         //BrowserRouter
import Header from './header';
import { Globalstyle } from './style'
import Home from './page/home';
import Footer from './footer';
import ListPage from  './page/ListPage';
import HtmlPage from  './page/HtmlPage';
class App extends Component {
  render() {
    return (
      <Provider store={store} >
          <Globalstyle/>
      <HashRouter>
          <Header/>
          <Switch>          {/*从第一个开始匹配*/}
          <Route path='/' exact component={Home}/>
          <Route path='/ListPage' exact component={ListPage}/>
          <Route path='/HtmlPage' exact component={HtmlPage}/>
              <Redirect path="/" to={{pathname: '/'}} />     {/*重定向*/}
              {/*<Route  exact component={Home}/>*/}{/*设置默认*/}
          </Switch>
          <Footer/>
         </HashRouter>
       </Provider>
    );
  }
}

export default App;
